package com.bingbing.back.controller;

import com.bingbing.back.dto.SchoolMajorScoreDto;
import com.bingbing.back.po.SchoolMajorScore;
import com.bingbing.back.service.SchoolMajorScoreService;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@CrossOrigin
@RestController
@RequestMapping("/schoolMajorScore")
public class SchoolMajorScoreController {

    @Resource
    private SchoolMajorScoreService schoolMajorScoreService;

    /**
     * 根据学校id和年份查询所有录取批次
     * @param schoolId
     * @param admYear
     * @return
     */
    @RequestMapping("/showBatch")
    public List<String> showBatch(int schoolId, int admYear) {
        return schoolMajorScoreService.showBatch(schoolId, admYear);
    }
    /**
     * 返回查询的最低分，最低位次，选课要求
     * @param schoolMajorScore 必须包含学校schoolId，和招生年份admYear，可加上录取批次admMajorBatch
     * @return
     */
    @RequestMapping("/showMajorScore")
    List<SchoolMajorScoreDto> showMajorScore(SchoolMajorScore schoolMajorScore){
        return schoolMajorScoreService.showMajorScore(schoolMajorScore);
    }
}
